<template>
  <img
    :src="realname == 2 ? reIcon : notReIcon"
    alit=""
    class="re-icon"
    @click.stop="handleReal"
    v-if="realname == 2 || page == 'my'"
  />
</template>

<script setup>
import reIcon from "@/static/common/realname-icon.svg";
import notReIcon from "@/static/common/not-real-icon.svg";
import { getItem } from "@/utils/storage";

const props = defineProps({
  realname: {
    type: [String, Number],
    default: 0,
  },
  page: {
    type: String,
    default: "",
  },
});

const handleReal = () => {
  const { appLogin } = getItem("user_info") || {};
  if (appLogin) {
    uni.navigateTo({ url: "/subPages/realname/index" });
  }
};
</script>

<style lang="scss" scoped>
.re-icon {
  width: 140rpx;
  height: 40rpx;
  margin-left: 10rpx;
}
</style>
